#ifndef ACCOUNT_H
#define ACCOUNT_H

#include <string>
#include <iostream>

class Account
{
public:
    void calculate() { amount += amount * intersetRate; }
    static double rate() { return intersetRate; }
    static void rate(double);
private:
    std::string owner;
    double amount;
    static double intersetRate;
    static double initRate();
    static constexpr int period = 30;  // period是常量表达式
    double daily_tbl[period];
};

void Account::rate(double newRate)
{
    intersetRate = newRate;
}

#endif // ACCOUNT_H
